import React, {Component} from "react";
import {observer} from "mobx-react";
import DevTools from 'mobx-react-devtools';
import ProductStore from "stores/product"
@observer
class App extends Component {
    constructor(props) {
        super(props);
    }
    onReset() {
    }
    add() {
        ProductStore.addList("dfc");
    }
    render() {
        const {list}=ProductStore;
        return (
            <div>
                <header>
                    <div className="title">
                        我是头部分
                    </div>
                </header>
                <div className="content">
                    <div>
                        <button onClick={this.add.bind(this)}>添加任务</button>
                    </div>
                    <div className="list">
                        <h3>任务列表</h3>
                        <ul>
                            {
                                list.map((item, index)=> {
                                    console.log(item);
                                    return (
                                        <li key={index}>{item.task}</li>
                                    );
                                })
                            }
                        </ul>
                    </div>
                </div>
            </div>
        );
    }
}
export default App;